package com.hpeng.sys.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.hpeng.sys.dao.DepartmentsDao;
import com.hpeng.sys.dao.StaDao;
import com.hpeng.sys.model.Department;
import com.hpeng.sys.model.Staff;
import com.hpeng.util.GenericDaoImpl;

@Component("staDao")
public class StaDaoImpl extends GenericDaoImpl<Staff, String> implements StaDao{
	public List<Staff> getStaffByName(String staname){
		System.out.println(staname);
		List<Staff> staffs = null;
		staffs = getByHql("from Staff staff where staff.staname like '%"+staname+"%'");
		return staffs;
	}
	public List<Staff> getStaffBydepid(String depid){
		List<Staff> staffs = null;
		staffs = getByHql("from Staff staff where staff.department='"+depid+"'");
		return staffs;
	}
	public List<Staff> findStaff(){
		System.out.println("zzzzzzzzzzzzzzzzzzzzzzz");
		List<Staff> staffs = null;
		staffs = getAll();
		return staffs;
	}
	public Staff getById(String id){
		return get(id);
	}
}
